//
//  NewsFeedContentViewController.m
//  Mecca
//
//  Created by Nico Villanueva iOS Dev on 9/10/14.
//  Copyright (c) 2014 TapDash Heuristics. All rights reserved.
//

#import "NewsFeedContentViewController.h"

#import "UIManager.h"

#import "ParserClass.h"

#import "NewsFeed.h"

#import "FTWAPI.h"


@interface NewsFeedContentViewController (){
    
    NSString *articleID;
    NSString *articleTitle;
    NSString *articleImage;
    NSString *description;
    NSString *date;
    
    FTWAPI *ftwApi;
    
}

@end

@implementation NewsFeedContentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    if (!ftwApi) {
        ftwApi = [FTWAPI sharedInstance];
    }
    
    self.lblTitle.text = articleTitle;
    self.txtDesc.text = description;
    self.lblDate.text = date;
    
    [ftwApi setupCoverImage:self.img withURL:articleImage];
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)btnBack:(id)sender {
    
    [self.navigationController popViewControllerAnimated:YES];
    
}

-(void)getData:(NSArray *)details{
    
    articleID = [details objectAtIndex:0];
    articleTitle = [details objectAtIndex:1];
    articleImage = [NSString stringWithFormat:@"http://192.185.93.102/~boomeran/backend-panel/%@", [details objectAtIndex:2]];
    
    
    description = [details objectAtIndex:3];
    date = [details objectAtIndex:4];
    
    NSLog(@"Image = %@", articleImage);

    
}





@end
